﻿using HelloOne.OcelotSvc.Models;
using HelloOne.OcelotSvc.ViewModels;
using HelloOne.Repositories;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;

namespace HelloOne.OcelotSvc.Controllers
{
    [Produces("application/json")]
    [Route("api/ReRoute")]
    public class ReRouteController : Controller
    {
        #region
        private IRepository<ReRoute> _repository { get; }
        #endregion
        public ReRouteController(IRepositoryProvider repositoryProvider)
        {
            _repository = repositoryProvider.Create<ReRoute>();
        }

        public IEnumerable<ReRoute> Get()
        {
            return new List<ReRoute>();
        }

        public ReRoute Get(string id)
        {
            return new ReRoute();
        }

        public void Post(ReRouteViewModel model)
        {
            var x = new ReRoute()
            {
                AddClaimsToRequest = model.AddClaimsToRequest
            };
            this._repository.Save(x);
        }
    }
}